﻿using System;
using UnityEngine;
using UnityEngine.SceneManagement;

// Token: 0x0200032B RID: 811
public class AssetBundleLoadLevelOperation : AssetBundleLoadOperation
{
	// Token: 0x06001477 RID: 5239 RVA: 0x0008EB08 File Offset: 0x0008CD08
	public AssetBundleLoadLevelOperation(string assetbundleName, string levelName, bool isAdditive, string manifestAssetBundleName)
	{
		this.m_AssetBundleName = assetbundleName;
		this.m_LevelName = levelName;
		this.m_IsAdditive = isAdditive;
		this.m_ManifestAssetBundleName = manifestAssetBundleName;
	}

	// Token: 0x170001FC RID: 508
	// (get) Token: 0x06001478 RID: 5240 RVA: 0x0008EB30 File Offset: 0x0008CD30
	public AsyncOperation Request
	{
		get
		{
			return this.m_Request;
		}
	}

	// Token: 0x06001479 RID: 5241 RVA: 0x0008EB38 File Offset: 0x0008CD38
	public override bool Update()
	{
		if (this.m_Request != null)
		{
			return false;
		}
		LoadedAssetBundle loadedAssetBundle = AssetBundleManager.GetLoadedAssetBundle(this.m_AssetBundleName, out this.m_DownloadingError, this.m_ManifestAssetBundleName);
		if (loadedAssetBundle != null)
		{
			this.m_Request = SceneManager.LoadSceneAsync(this.m_LevelName, (!this.m_IsAdditive) ? LoadSceneMode.Single : LoadSceneMode.Additive);
			return false;
		}
		return true;
	}

	// Token: 0x0600147A RID: 5242 RVA: 0x0008EB98 File Offset: 0x0008CD98
	public override bool IsDone()
	{
		if (this.m_Request == null && this.m_DownloadingError != null)
		{
			GlobalData.Debug_LogError(this.m_DownloadingError);
			return true;
		}
		return this.m_Request != null && this.m_Request.isDone;
	}

	// Token: 0x040018F9 RID: 6393
	protected string m_AssetBundleName;

	// Token: 0x040018FA RID: 6394
	protected string m_LevelName;

	// Token: 0x040018FB RID: 6395
	protected string m_ManifestAssetBundleName;

	// Token: 0x040018FC RID: 6396
	protected bool m_IsAdditive;

	// Token: 0x040018FD RID: 6397
	protected string m_DownloadingError;

	// Token: 0x040018FE RID: 6398
	protected AsyncOperation m_Request;
}
